#! /usr/bin/env python

import rospy
from plumbing_server_client.srv import AddInts,AddIntsRequest,AddIntsResponse


def doSum(request):
    num1 = request.num1
    num2 = request.num2
    sum = num1 + num2
    response = AddIntsResponse()
    response.sum = sum
    rospy.loginfo("request data: num1 = %d, num2 = %d, response data sum = %d",num1,num2,sum)

    return response

if __name__=="__main__":

    rospy.init_node("heshui22")
    server = rospy.Service("addInts",AddInts,doSum)


    rospy.spin()